import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:yi_shop/utils/colors.dart';
import 'package:yi_shop/utils/styles.dart';
import 'package:yi_shop/utils/tools.dart';

class WalletCardCaseController extends GetxController {}

class WalletCardCasePage extends GetView<WalletCardCaseController> {
  const WalletCardCasePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(        leading: ToolsUtils.builderLeading(),
        title: Text(
          '卡包',
          style: StylesUtils.customTextStyle(
              fontSize: StylesUtils.fontSize18, fontWeight: FontWeight.w700),
        ),
        actions: [
          IconButton(onPressed: () {}, icon: ToolsUtils.image('card2.png', width: 30, height: 25))
        ],
      ),
      body: ListView(
        children: [
          Container(
            padding: const EdgeInsets.symmetric(vertical: 15),
            alignment: Alignment.center,
            child: Text(
              '还不是会员哦，一大波品牌正在来袭，快来加入',
              style: StylesUtils.customTextStyle(color: ColorsUtils.color9999),
            ),
          ),
          for (var i = 0; i < 15; i++)
            Container(
            alignment: Alignment.center,
            margin: const EdgeInsets.only(bottom: 15),
            child: Container(
              decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.circular(5),
              ),
              padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 15),
              constraints: const BoxConstraints.expand(width: 345, height: 260),
              alignment: Alignment.centerLeft,
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Wrap(
                        spacing: 15,
                        crossAxisAlignment: WrapCrossAlignment.center,
                        alignment: WrapAlignment.start,
                        children: [
                          const CircleAvatar(
                            radius: 15,
                            backgroundImage: CachedNetworkImageProvider(
                                'https://wwc.alicdn.com/avatar/getAvatar.do'),
                          ),
                          Text(
                            '美的会员',
                            style: StylesUtils.customTextStyle(color: ColorsUtils.color3333),
                          )
                        ],
                      ),
                      TextButton(
                          onPressed: () {},
                          style: ButtonStyle(
                              minimumSize: const MaterialStatePropertyAll(Size(80, 30)),
                              padding: const MaterialStatePropertyAll(EdgeInsets.zero),
                              alignment: Alignment.center,
                              shape: MaterialStatePropertyAll(RoundedRectangleBorder(
                                  borderRadius: BorderRadius.circular(5),
                                  side: BorderSide(
                                      color: ColorsUtils.parseColorFromHexString(
                                          ColorsUtils.colorF048))))),
                          child: Text(
                            '+加入会员',
                            style: StylesUtils.customTextStyle(
                                color: ColorsUtils.colorF048, fontSize: StylesUtils.fontSize13),
                          )),
                    ],
                  ),
                  Padding(
                    padding: const EdgeInsets.symmetric(vertical: 15),
                    child: Text(
                      '注册美的会员 福利领不停',
                      style: StylesUtils.customTextStyle(color: ColorsUtils.color3333),
                    ),
                  ),
                  Center(
                    child: ClipRRect(
                      borderRadius: BorderRadius.circular(5),
                      child: CachedNetworkImage(
                        imageUrl:
                            'https://gw.alicdn.com/imgextra/i4/5066157423/O1CN01P3I8To24hmad5xkRx_!!5066157423.jpg',
                        height: 137,
                        width: 314,
                        fit: BoxFit.fill,
                      ),
                    ),
                  )
                ],
              ),
            ),
          ),
        ],
      ),
    );
  }
}
